package domfarr.logging;

import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;


public class LoggingTest {
	private static Logger logger = Logger.getLogger(LoggingTest.class.getCanonicalName());
    private static FileHandler fh;
    public static void main(String argv[]) throws SecurityException, IOException {
    	fh = new FileHandler("mylog.txt");
        // Send logger output to our FileHandler.
        logger.addHandler(fh);
        // Request that every detail gets logged.
        logger.setLevel(Level.ALL);
        // Log a simple INFO message.
        logger.info("doing stuff!");
        try {
            Wombat.sneeze();
        } catch (Exception ex) {
            logger.log(Level.WARNING, "trouble sneezing", ex);
        }
        logger.fine("done");
    }

}
